<?php
  //upload picture 
  //submit picture and text. picture stored in disk, path stored in mysql.
  //text stored in mysql.
  //to be a friend of sb. else. 
  //when sb. publish, I will see his content(picture + text)
require_once(dirname(__FILE__). '/common/app.php');
require_once(dirname(__FILE__)). '/common/Cache.php';
require_once(dirname(__FILE__)). '/common/Common.php';
require_once(dirname(__FILE__)). '/common/Config.php';
require_once(dirname(__FILE__)). '/common/DB.php';
require_once(dirname(__FILE__)). '/common/Image.php';
require_once(dirname(__FILE__)). '/common/Table.php';

if ($_POST) {
	$team = $_POST;
	$insert = array('image','summary');
	$team['image'] = upload_image('upload_image', null, 'team');
	
	$table = new Table('team', $team);
	$table->insert($insert);
}
?>
<link rel="stylesheet" href="/css/index.css" type="text/css" />
<form id="login-user-form" method="post" action="index.php" enctype="multipart/form-data" class="validator">
	<div class="field">
		<label>upload</label>
		<input type="file" size="30" name="upload_image" id="team-create-image" class="f-input" />
	</div>
	<div class="field">
		<label> </label>
		<div style="float:left;"><textarea cols="45" rows="5" name="summary" id="team-create-summary" class="f-textarea editor"></textarea></div>
	</div>
	<div class="act">
		<input type="submit" value="Go" name="commit" id="leader-submit" class="formbutton"/>
	</div>
</form>
